home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 9 / The PC-SIG Library on CD ROM - Ninth Edition.iso / 801_900 / DISK0873 / DISK0873.ZIP / BOSS_SUP.LZH / WINDOWS.H < prev    next >
C/C++ Source or Header  |  1990-05-31  |  26KB  |  706 lines

  1. /*
  2. ** WINDOW BOSS - Simple but Elegant Window Functions 
  3. **
  4. ** Lattice, Computer Innovations, Microsoft, Datalight, Aztec, 
  5. ** Watcom, Mix Power C, Zortech
  6. **
  7. ** Copyright (c) 1984, 1985, 1986 - Philip A. Mongelluzzo
  8. ** All rights reserved.
  9. **
  10. ** The complex web of compiler defines and feature tests follows.
  11. */
  12.  
  13. /*
  14. ** Computer Innovations comes first....
  15. */
  16.  
  17. #ifdef C86
  18. #define BORLAND 0
  19. #define MSCV3   0
  20. #define MSCV4   0
  21. #define MSCV6   0
  22. #define MSC     0
  23. #define MSC3    0
  24. #define MSC4    0
  25. #define DLC     0
  26. #define CI86    1
  27. #define LC2     0
  28. #define LC3     0
  29. #define LC6     0
  30. #define __ZTC__ 0
  31. #define MIXPC   0
  32. #define AZTEC   0
  33. #define WATCOM  0
  34. #ifdef _C86_BIG
  35. #define LPTR    1
  36. #define SPTR    0
  37. #else
  38. #define LPTR    0
  39. #define SPTR    1
  40. #endif
  41. #define LATTICE 0
  42. #define void int                        /* define void as int */
  43. struct WORDREGS {                       /* register layout is */
  44.         unsigned int ax;                /* different from the rest !! */
  45.         unsigned int bx;
  46.         unsigned int cx;
  47.         unsigned int dx;
  48.         unsigned int si;
  49.         unsigned int di;
  50.         unsigned int ds;                /* <= NB */
  51.         unsigned int es;                /* <= NB */
  52.         unsigned int flags;
  53.         };
  54. struct BYTEREGS {
  55.         unsigned char al, ah;
  56.         unsigned char bl, bh;
  57.         unsigned char cl, ch;
  58.         unsigned char dl, dh;
  59.         };
  60. union REGS {
  61.         struct WORDREGS x;
  62.         struct BYTEREGS h;
  63.         };
  64. struct SREGS {
  65.         unsigned int cs;
  66.         unsigned int ss;
  67.         unsigned int ds;
  68.         unsigned int es;
  69.         };
  70. extern unsigned wns_mtype();            /* make everyone happy */
  71. #endif                                  /* end C86 Stuff */
  72.  
  73.  
  74. #if WATCOM
  75. #pragma aux v_stksp "_*" parm caller []                           \
  76.                          value struct float struct routine [ax]   \
  77.                          modify [ax bx cx dx es]; 
  78.  
  79. #pragma aux _putca "_*" parm caller []                           \
  80.                          value struct float struct routine [ax]   \
  81.                          modify [ax bx cx dx es]; 
  82.  
  83. #pragma aux _getca "_*" parm caller []                           \
  84.                          value struct float struct routine [ax]   \
  85.                          modify [ax bx cx dx es]; 
  86.  
  87. #pragma aux _absloc "_*" parm caller []                           \
  88.                          value struct float struct routine [ax]   \
  89.                          modify [ax bx cx dx es]; 
  90.  
  91. #pragma aux v_wca "_*" parm caller []                           \
  92.                          value struct float struct routine [ax]   \
  93.                          modify [ax bx cx dx es];
  94.  
  95. #pragma aux v_wtty "_*" parm caller []                           \
  96.                          value struct float struct routine [ax]   \
  97.                          modify [ax bx cx dx es]; 
  98.  
  99. #pragma aux v_cls "_*" parm caller []                           \
  100.                          value struct float struct routine [ax]   \
  101.                          modify [ax bx cx dx es];
  102.  
  103. #pragma aux v_spage "_*" parm caller []                           \
  104.                          value struct float struct routine [ax]   \
  105.                          modify [ax bx cx dx es]; 
  106.  
  107. #pragma aux v_smode "_*" parm caller []                           \
  108.                          value struct float struct routine [ax]   \
  109.                          modify [ax bx cx dx es]; 
  110.  
  111. #pragma aux v_locate "_*" parm caller []                           \
  112.                          value struct float struct routine [ax]   \
  113.                          modify [ax bx cx dx es]; 
  114.  
  115. #pragma aux v_hidec "_*" parm caller []                           \
  116.                          value struct float struct routine [ax]   \
  117.                          modify [ax bx cx dx es]; 
  118.  
  119. #pragma aux v_sapu "_*" parm caller []                           \
  120.                          value struct float struct routine [ax]   \
  121.                          modify [ax bx cx dx es]; 
  122.  
  123. #pragma aux v_sapd "_*" parm caller []                           \
  124.                          value struct float struct routine [ax]   \
  125.                          modify [ax bx cx dx es]; 
  126.  
  127. #pragma aux v_rcpos "_*" parm caller []                           \
  128.                          value struct float struct routine [ax]   \
  129.                          modify [ax bx cx dx es]; 
  130.  
  131. #pragma aux v_rcvs "_*" parm caller []                           \
  132.                          value struct float struct routine [ax]   \
  133.                          modify [ax bx cx dx es]; 
  134.  
  135. #pragma aux v_getch "_*" parm caller []                           \
  136.                          value struct float struct routine [ax]   \
  137.                          modify [ax bx cx dx es]; 
  138.  
  139. #pragma aux v_kflush "_*" parm caller []                           \
  140.                          value struct float struct routine [ax]   \
  141.                          modify [ax bx cx dx es]; 
  142.  
  143. #pragma aux v_kstat "_*" parm caller []                           \
  144.                          value struct float struct routine [ax]   \
  145.                          modify [ax bx cx dx es]; 
  146.  
  147. #pragma aux v_sctype "_*" parm caller []                           \
  148.                          value struct float struct routine [ax]   \
  149.                          modify [ax bx cx dx es]; 
  150.  
  151. #pragma aux xferdata "_*" parm caller []                           \
  152.                          value struct float struct routine [ax]   \
  153.                          modify [ax bx cx dx es]; 
  154.  
  155. #pragma aux v_border "_*" parm caller []                           \
  156.                          value struct float struct routine [ax]   \
  157.                          modify [ax bx cx dx es]; 
  158.  
  159. #pragma aux _vidblt "_*" parm caller []                           \
  160.                          value struct float struct routine [ax]   \
  161.                          modify [ax bx cx dx es]; 
  162.  
  163. #pragma aux _putca "_*" parm caller []                           \
  164.                          value struct float struct routine [ax]   \
  165.                          modify [ax bx cx dx es]; 
  166. #endif
  167.  
  168. /*
  169. ** Microsoft 4.0, 5.X, 6.X, QuickC, PowerC
  170. */
  171.  
  172.  
  173. #if MSCV6
  174. #undef NULL                             /* NULL must be redefined */
  175. #define NULL (int)0                     /* to avoid useless errors MSC 6.XX */
  176. #define MSCV4   1
  177. #endif
  178.  
  179. #if MSCV4
  180. #define MSC     1
  181. #define MSCV3   0
  182. #define MSC4    1
  183. #define DLC     0
  184. #define CI86    0
  185. #define LC2     0
  186. #define LC3     0
  187. #define BORLAND 0
  188. #ifndef MIXPC
  189. #define MIXPC   0
  190. #endif
  191. #define AZTEC   0
  192. #ifdef M_I86SM                          /* small code, small data */
  193. #define SPTR    1
  194. #define LPTR    0
  195. #endif
  196. #ifdef M_I86LM                          /* large code, large data */
  197. #define SPTR    0
  198. #define LPTR    1
  199. #endif
  200. #ifdef M_I86CM                          /* small code, large data */
  201. #define SPTR    0
  202. #define LPTR    1
  203. #endif
  204. #ifdef M_I86MM                          /* large code, small data */
  205. #define SPTR    1
  206. #define LPTR    0
  207. #endif
  208. #define LATTICE 1
  209. #endif
  210.  
  211. /*
  212. ** Microsoft 3.00
  213. */
  214.  
  215. #if MSCV3
  216. #define MSC     1
  217. #define MSC4    0
  218. #define DLC     0
  219. #define CI86    0
  220. #define LC2     0
  221. #define LC3     0
  222. #define BORLAND 0
  223. #define MIXPC   0
  224. #ifndef AZTEC
  225. #define AZTEC   0
  226. #endif
  227. #ifdef M_I86SM                          /* small code, small data */
  228. #define SPTR    1
  229. #define LPTR    0
  230. #endif
  231. #ifdef M_I86LM                          /* large code, large data */
  232. #define SPTR    0
  233. #define LPTR    1
  234. #endif
  235. #ifdef M_I86CM                          /* small code, large data */
  236. #define SPTR    0
  237. #define LPTR    1
  238. #endif
  239. #ifdef M_I86MM                          /* large code, small data */
  240. #define SPTR    1
  241. #define LPTR    0
  242. #endif
  243. #define LATTICE 1
  244. #endif
  245.  
  246. /*
  247. ** Lattice 6.XX
  248. */
  249.  
  250. #if LC6                                 /* Lattice 6 looks like BORLAND! */
  251. #define BORLAND 1                       /* from a code standpoint */
  252. #undef NULL                             /* NULL must be redefined */
  253. #define NULL (int)0                     /* to avoid useless errors */
  254. #endif                                  /* any changes here must also */
  255.                                         /* be made in "windows.c" */
  256.  
  257. /*
  258. ** Zortech
  259. */
  260.  
  261. #if __ZTC__                             /* ZORTECH looks like BORLAND! */
  262. #define BORLAND 1                       /* from a code standpoint */
  263. #undef NULL                             /* NULL must be undefined */
  264. #endif                                  /* any changes here must also */
  265.                                         /* be made in "windows.c" */
  266. /*
  267. ** BORLAND
  268. */
  269.  
  270. #ifdef __TURBOC__
  271. #ifndef BORLAND
  272. #define BORLAND 1
  273. #endif
  274. #endif
  275.  
  276. #if BORLAND
  277. #define MSC     1
  278. #define MSC4    1
  279. #define DLC     0
  280. #define CI86    0
  281. #define LC2     0
  282. #define LC3     0
  283. #define MIXPC   0
  284. #define AZTEC   0
  285. #ifdef __SMALL__                        /* small code, small data */
  286. #define SPTR    1
  287. #define LPTR    0
  288. #endif
  289. #ifdef __LARGE__                        /* large code, large data */
  290. #define SPTR    0
  291. #define LPTR    1
  292. #endif
  293. #ifdef __COMPACT__                      /* small code, large data */
  294. #define SPTR    0
  295. #define LPTR    1
  296. #endif
  297. #ifdef __MEDIUM__                       /* large code, small data */
  298. #define SPTR    1
  299. #define LPTR    0
  300. #endif
  301. #ifdef __HUGE__                         /* large code, large data */
  302. #define SPTR    0
  303. #define LPTR    1
  304. #endif
  305. #define LATTICE 1
  306. #endif
  307.  
  308. #define TRUE    1                       /* truth */
  309. #define FALSE   0                       /* lies */
  310. #define The_BOSS TRUE                   /* convienent equate */
  311.  
  312. #include "stdio.h"                      /* standard header */
  313. #if CI86
  314. char *malloc(), *calloc();              /* for the OLD TIMER */
  315. #else
  316. #include "stdlib.h"                     /* For the rest */
  317. #endif
  318. #if LC6
  319. #include "string.h"                     /* Now for Lattice 6.XX */
  320. #endif
  321.  
  322. #if BORLAND | MSC | DLC | LC2 | LC3 | MIXPC | WATCOM | CI86
  323. #if AZTEC
  324. #else
  325. #include "dos.h"                        /* Lattice stuff */
  326. #endif
  327. #endif
  328. #include "ctype.h"                      /* character conversion stuff */
  329. #if MSC4
  330. #include "stdarg.h"                     /* variable arg list marcos */
  331. #endif
  332.  
  333. #if AZTEC                               /* AZTEC DOS.H */
  334.  
  335. struct WORDREGS {
  336.     unsigned int ax;
  337.     unsigned int bx;
  338.     unsigned int cx;
  339.     unsigned int dx;
  340.     unsigned int si;
  341.     unsigned int di;
  342.     unsigned int cflag;
  343.     };
  344.  
  345. struct BYTEREGS {
  346.     unsigned char al, ah;
  347.     unsigned char bl, bh;
  348.     unsigned char cl, ch;
  349.     unsigned char dl, dh;
  350.     };
  351.  
  352. union REGS {
  353.     struct WORDREGS x;
  354.     struct BYTEREGS h;
  355.     };
  356.  
  357. struct SREGS {
  358.     unsigned int cs;
  359.     unsigned int ss;
  360.     unsigned int ds;
  361.     unsigned int es;
  362.     };
  363.  
  364. #define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
  365. #define FP_OFF(fp) (*((unsigned *)&(fp)))
  366.  
  367. struct RS {
  368.   int ax, bx, cx, dx, si, di, ds, es;
  369. };
  370. #endif                                  /* End AZTEC DOS.H */
  371.  
  372. #define SAVE    TRUE                    /* similar truth */
  373. #define RESTORE FALSE                   /* fibs */
  374. #define PAINT   TRUE                    /* screen update modes */
  375. #define FLASH   FALSE                   /* ditto */
  376. #define REPLACE 1                       /* for flicker free */
  377. #define ERASE   0                       /* scroll w_sapd & w_sapu */
  378. #define FAST    0x01                    /* fast retrace */
  379. #define SLOW    0x08                    /* slow retrace */
  380.  
  381. #define NULPTR  (char *) 0              /* null pointer */
  382. #define NUL     '\0'                    /* NUL char */
  383. #define NVAL    0                       /* null value - INTEGER */
  384. #define ECHO    0x8000                  /* echo disable bit */
  385.  
  386. #define BIOS    0x01                    /* BIOS Scrolling */
  387. #define DMAS    0x02                    /* The BOSS's DMA Scrolling */
  388.  
  389. #define MO_LEFT   0                     /* Mouse left button */
  390. #define MO_RIGHT  1                     /* Mouse right button */
  391. #define MO_HDW    1                     /* Mouse hardware */
  392. #define MO_SFT    0                     /* Mouse software */
  393.  
  394. #define WNTOPR  1                       /* top rigth */
  395. #define WNTOPL  2                       /* top left */
  396. #define WNTOPC  3                       /* top center */
  397. #define WNBOTR  4                       /* bottom right */
  398. #define WNBOTL  5                       /* bottom left */
  399. #define WNBOTC  6                       /* bottom center */
  400.  
  401. /*
  402. ** The following 2 equates are needed by Lattice Ver 2.XX (which is
  403. ** no longer "officially" supported.  Lattice Ver 2.XX users that need
  404. ** to work with larger Physical screens must change these constants here
  405. ** and in "windows.c". Other users can use the wns_ssiz() function.  Refer
  406. ** to wn_sup.c for usage.
  407. */
  408.  
  409. #define WN_MXROWS 25                    /* MAX PHYSICAL SCREEN */
  410. #define WN_MXCOLS 80                    /* MAX PHYSICAL SCREEN */
  411. #define MAXIMAGES 10                    /* MAX # of PUSH/POP IMAGES */      
  412.  
  413. #define BCUL  wns_bchars[0]             /* some shorthand for later */
  414. #define BCUR  wns_bchars[1]
  415. #define BCTB  wns_bchars[2]
  416. #define BCSD  wns_bchars[3]
  417. #define BCLL  wns_bchars[4]
  418. #define BCLR  wns_bchars[5]
  419.  
  420. /*
  421. ** HELP System Stuff
  422. */
  423.  
  424. #define HLPMAXKY 255                    /* ISAM file length (# of keys) */
  425. #define HLPKEYLN 25                     /* Maximum KEY length */
  426.  
  427. /*
  428. ** Misc Stuff
  429. */
  430.  
  431. #define WMR   wn->bsize                 /* shorthand */
  432.  
  433. typedef struct wcb                      /* Window control block */
  434. {
  435. int ulx,                                /* upper left corner x coordinate */
  436.     uly,                                /* upper left corner y coordinate */
  437.     xsize,                              /* width of window - INSIDE dimension */
  438.     ysize,                              /* height of window -INSIDE dimension */
  439.     ccx,                                /* virtual cursor offset in window */
  440.     ccy,
  441.     style,                              /* attribute to be used in window */
  442.     bstyle,                             /* border attribute */
  443.     bsize;                              /* total border size 0 or 2 only */
  444. char *scrnsave;                         /* pointer to screen save buffer */
  445. int page,                               /* current video page being used */
  446.     oldx,                               /* cursor position when window was */
  447.     oldy,                               /* opened (used for screen restore) */
  448.     wrpflg,                             /* wrap flag */
  449.     synflg;                             /* cursor sync flag */
  450. char *handle;                           /* my own id */
  451.     char *prevptr;                      /* linked list - previous */
  452.     char *nextptr;                      /* linked list - next */
  453.     unsigned tmpseg;                    /* for activate */
  454.     unsigned tmpoff;                    /* ditto */
  455.     int  smeth;                         /* scroll method to use */
  456.     int  shadow;                        /* shadow flag */
  457. char *rshwin;                           /* right shadow WINDOWPTR */
  458. char *bshwin;                           /* bottom shadow WINDOWPTR */
  459. } WINDOW, *WINDOWPTR;
  460.  
  461. typedef struct mcb                      /* Mouse control block */
  462. {
  463. int exists,                             /* TRUE if MOUSE exists */
  464.     nbuts,                              /* number of buttons */
  465.     bstat,                              /* button status */
  466.     nclik,                              /* number of clicks */
  467.     col,                                /* position - column */
  468.     row,                                /* position - row */
  469.     hmove,                              /* net horizontal movement */
  470.     vmove;                              /* net vertical movement */
  471.     char *handle;                       /* my own id */
  472. } MOUSE, *MOUSEPTR;         
  473.  
  474. union wi_args {                         /* variable arg type union */
  475.   int vi;                               /* (int) */
  476.   int *vip;                             /* (int *) */ 
  477.   unsigned int vui;                     /* (unsigned int) */
  478.   unsigned int *vuip;                   /* (unsigned int *) */
  479.   char vc;                              /* (char) */
  480.   char *vcp;                            /* (char *) */
  481.   long vl;                              /* (long) */
  482.   long *vlp;                            /* (long *) */
  483.   unsigned long vul;                    /* (unsigned long) */
  484.   unsigned long *vulp;                  /* (unsigned long *) */
  485.   float vf;                             /* (float) */
  486.   float *vfp;                           /* (float *) */
  487.   double vd;                            /* (double) */
  488.   double *vdp;                          /* (double *) */
  489.   unsigned char *vuc;                   /* (unsiged char) */
  490.   unsigned char *vucp;                  /* (unsigned char *) */
  491. } ;
  492.  
  493. typedef struct wi_scb {                 /* screen control block */
  494.   char *pself;                          /* pointer to myself */
  495.   int fcode;                            /* input funtion code */
  496.   WINDOWPTR wn;                         /* the window */
  497.   int row;                              /* window (wn) location - row */
  498.   int col;                              /* window (wn) location - col */
  499.   char *prmpt;                          /* prompt string for field */
  500.   unsigned int atrib;                   /* input field attribute */
  501.   char fill;                            /* input field fill character */
  502.   union wi_args v1;                     /* whatever */
  503.   union wi_args v2;                     /* whatever */
  504.   union wi_args v3;                     /* whatever */
  505.   union wi_args v4;                     /* whatever */
  506.   union wi_args v5;                     /* whatever */
  507.   union wi_args v6;                     /* whatever */
  508.   union wi_args v7;                     /* whatever */
  509.   union wi_args v8;                     /* whatever */
  510. } WIFLD, *WIFLDPTR, **WIFORM;
  511.  
  512.   struct mitem {                        /* POPUP menu item template */
  513.     int r;                              /* row */
  514.     int c;                              /* col */
  515.     char *t;                            /* text */
  516.     int rv;                             /* return value */
  517.   };
  518.  
  519.   struct pmenu {                        /* POPUP menu structure */
  520.     WINDOWPTR wpsave;                   /* place to hold window id */
  521.     int winopn;                         /* leave window open flag */
  522.     int lndx;                           /* last index */
  523.     int fm;                             /* first menu item index */
  524.     int lm;                             /* last menu item index */
  525.     struct mitem scrn[WN_MXROWS*4];     /* a bunch of menu items */
  526.   };                                    /* NOTE RELATIVE LIMIT */
  527.  
  528.  
  529. #if MSCV3 | MSCV4 | BORLAND | DLC | LC3 /* allow for LINT_ARGS */
  530. #ifndef GENFNS
  531. #include "windows.fns"                  /* enforce type checking */
  532. #endif
  533. #else                                   /* and almost lint args */
  534. struct wcb *wn_open();
  535. struct wcb *wn_move();
  536. struct wcb *wn_save();
  537. struct mcb *mo_reset();
  538. char *wn_gets();
  539. char *wn_sleftj();
  540. char *wn_srightj();
  541. char *wn_scenter();
  542. char *wn_sdelspc();
  543. struct wcb *wn_save();
  544. struct wi_scb * *wn_frmopn();
  545. unsigned int wns_mtype();
  546. #endif
  547.  
  548. #define BLACK   0x00                    /* foreground */
  549. #define RED     0x04                    /* background */
  550. #define GREEN   0x02                    /* colors */
  551. #define YELLOW  0x06                    /* bg << 4 | fg */
  552. #define BLUE    0x01
  553. #define MAGENTA 0x05
  554. #define CYAN    0x03
  555. #define WHITE   0x07
  556. #define BLINK   0x80
  557. #define BOLD    0x08
  558. #define NDISPB  0x00                    /* non display black */
  559. #define NDISPW  0x77                    /* non display white */
  560. #define RVIDEO  0x70                    /* reverse video */
  561. #define UNLINE  0x01                    /* under line (BLUE) */
  562.  
  563. #define NVIDEO  0x07                    /* normal video */
  564. #define NORMAL  0x03                    /* cyan is normal for me */
  565.  
  566. /*
  567. ** Display Mode Atributes
  568. */
  569.  
  570. #define B4025  0                        /* black & white 40 x 25 */
  571. #define C4025  1                        /* color 40 x 25 */
  572. #define B8025  2                        /* black & white 80 x 25 */
  573. #define C8025  3                        /* color 80 x 25 */
  574. #define C320   4                        /* color graphics 320 x 200 */
  575. #define B320   5                        /* black & white graphics */
  576. #define HIRES  6                        /* B&W hi res 640 * 200 */
  577. #define MONO   7                        /* monocrome 80 x 25 */
  578.  
  579. /*
  580. ** Macro to set attribute byte
  581. */
  582.  
  583. #define v_setatr(bg,fg,blink,bold) ((blink|(bg<<4))|(fg|bold))
  584. #define v_setrev(atrib) ((atrib&0x88) | ((atrib>>4)&0x07) | ((atrib<<4)&0x70) )
  585.  
  586. /*
  587. ** Key Scan Scodes & Window Input Stuff 
  588. */
  589.  
  590. #define LARROW          0x4b00          /* left arrow */
  591. #define RARROW          0x4d00          /* right arrow */
  592. #define DARROW          0x5000          /* down arrow */
  593. #define UARROW          0x4800          /* up arrow */
  594. #define HOME            0x4700          /* home key */
  595. #define END             0x4f00          /* end key */
  596. #define INS             0x5200          /* insert key */
  597. #define DEL             0x5300          /* delete key */        
  598. #define PGUP            0x4900          /* pgup */  
  599. #define PGDN            0x5100          /* pgdn */
  600. #define F1              0x3b00          /* F1 aka HELP */
  601. #define HELP            F1              /* same as F1 */
  602. #define TAB             0x0f09          /* tab */
  603. #define BKTAB           0x0f00          /* back (shift) tab */
  604. #define RET             0x1c0d          /* return */
  605. #define SPACE           0x3920          /* space */        
  606. #define ESCAPE          0x011b          /* escape */
  607.  
  608. /*
  609. ** Character codes (non scan codes)
  610. */
  611.  
  612. #define BELL            0x07            /* ring a ding */
  613. #define BS              0x08            /* backspace */
  614. #define ESC             0x1b            /* Escape */
  615. #define CR              0x0d            /* carriage return */
  616. #define LF              0x0a            /* linefeed */
  617. #define RUB             0x7f            /* delete */
  618. #define NAK             0x15            /* ^U */
  619. #define ETX             0x03            /* ^C */
  620. #define CAN             0x18            /* ^X */
  621.  
  622. /*
  623. ** Special Cases
  624. */
  625.  
  626. #define Del             0x53            /* Del key scan code >> 8 */
  627. #define ESC_CODE  -2                    /* return code: ESCAPE - ESC.001 */
  628.  
  629.                                         /* 0 to 100 are reserved!! */
  630. #define GDONE  0                        /* end of list */
  631. #define GDATE  10                       /* wn_gdate */
  632. #define GTIME  11                       /* wn_gtime */
  633. #define GINT   12                       /* wn_gint */
  634. #define GUINT  13                       /* wn_guint */
  635. #define GLONG  14                       /* wn_glong */
  636. #define GFLOAT 15                       /* wn_gfloat */
  637. #define GPHONE 16                       /* wn_gphone */
  638. #define GTEXT  17                       /* wn_gtext */
  639. #define GBOOL  18                       /* wn_gbool */
  640. #define DTEXT  19                       /* Display text only */
  641. #define GPWORD 20                       /* wn_gpword */
  642. #define GULONG 21                       /* wn_gulong */
  643. #define GDOUBL 22                       /* wn_gdouble */
  644. #define GUTEXT 23                       /* wn_gutext */
  645. #define GLTEXT 24                       /* wn_gltext */
  646. #define GATEXT 25                       /* wn_gatext */
  647.                                         /* from above to 100 are reserved!! */
  648.  
  649. #define NSTR ""                         /* null string */
  650. #define NFRM (WIFORM)(0)                /* null form pointer */
  651. #define NFLD 0                          /* must be int 0 */
  652. #define SET  1                          /* form setup */
  653. #define XEQ  2                          /* immediate execution */
  654. #define MAXSTR 80                       /* max size - wn_gtext, wn_input */         
  655.  
  656. #define WNLPTR (WINDOWPTR) 0            /* A TRUE NULL WINDOW POINTER */
  657. #define MOLPTR (MOUSEPTR) 0             /* A TRUE NULL MOUSE POINTER */
  658.  
  659. /*
  660. ** FAR MEMORY MACROS
  661. */
  662.  
  663. #if MSCV3 | MSCV4
  664. #define FPSEG(fp) (*((unsigned *)&(fp) + 1))
  665. #define FPOFF(fp) (*((unsigned *)&(fp)))
  666. #endif
  667.  
  668. #if DLC
  669. #define FPOFF(fp) ((unsigned) ((char *)(fp) - (char *)0))
  670. #define FPSEG(fp) (((unsigned *) (&(fp)))[1])
  671. #endif
  672.  
  673. #if BORLAND 
  674. #define FPOFF(fp) ((unsigned)(fp))
  675. #define FPSEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
  676. #endif
  677.  
  678. #if LC3
  679. #define FPOFF(fp) (unsigned)FP_OFF( (char far *) fp)
  680. #define FPSEG(fp) (unsigned)FP_SEG( (char far *) fp)
  681. #endif
  682.  
  683. #if CI86
  684. unsigned wns_off();
  685. unsigned wns_seg();
  686. unsigned long wns_gticks();
  687. #define intdos  sysint21
  688. #define int86 sysint
  689. #define int86x sysint
  690. #define FPOFF(fp) (unsigned)wns_off(fp)
  691. #define FPSEG(fp) (unsigned)wns_seg(fp)
  692. #endif
  693.  
  694. #if LC2
  695. #define FPOFF(fp) wns_off(fp)
  696. #define FPSEG(fp) wns_seg(fp)
  697. #endif
  698.  
  699. #ifndef N1ADE
  700. #include "windows.ext"                  /* load externals */
  701. #endif
  702.  
  703. #define WNBDEBUG        FALSE           /* disable debugging */
  704.  
  705. /* End */
  706.